package com.kele.oplog.config;

import org.springframework.amqp.core.Exchange;
import org.springframework.amqp.core.ExchangeBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.QueueBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class RabbitMQConfig1 {

    private static final String EXCHANGE_NAME = "exchange_remark";
    private static final String QUEUE_NAME = "queue_remark";

    @Bean(QUEUE_NAME)
    public Queue queueDeclare(){
        //return new Queue(QUEUE_NAME,true);
        return QueueBuilder.durable(QUEUE_NAME).build();
    }

    @Bean(EXCHANGE_NAME)
    public Exchange exchangeDeclare(){
        return ExchangeBuilder.directExchange(EXCHANGE_NAME).durable(true).build();
    }
}
